package org.starsource.forum.client.web;

import java.util.Set;

import org.starsource.forum.client.domain.CategoryObject;
import org.starsource.forum.client.domain.MessageObject;
import org.starsource.forum.client.domain.SessionObject;
import org.starsource.forum.client.exception.CategoryNotFoundException;
import org.starsource.forum.client.exception.DatabaseException;
import org.starsource.forum.client.exception.MessageNotFoundException;
import org.starsource.forum.client.exception.PermissionDeniedException;
import org.starsource.forum.client.exception.ResourceNotFoundException;
import org.starsource.forum.client.exception.SessionNotFoundException;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("forum")
public interface ForumService extends RemoteService {

	public Set<CategoryObject> getCategorySet() throws DatabaseException;

	public Set<SessionObject> getSessionSet() throws DatabaseException;

	public Set<SessionObject> getSessionSet(int categoryId) throws CategoryNotFoundException, DatabaseException;

	public Set<SessionObject> getSessionSetWithinCategory(int categoryId) throws CategoryNotFoundException, DatabaseException;

	public Set<SessionObject> getSessionSetKeywords(String keywords) throws DatabaseException;

	public SessionObject getSessionDetail(int sessionId) throws SessionNotFoundException, DatabaseException;

	public SessionObject createSession(String title, String content, int categoryId) throws CategoryNotFoundException, DatabaseException;

	public MessageObject followSession(String content, int sessionId) throws DatabaseException;

	public void removeSession(int sessionId) throws PermissionDeniedException, DatabaseException;

	public void removeMessage(int messageId) throws MessageNotFoundException, DatabaseException;

	public void removeResource(int resourceId) throws ResourceNotFoundException, DatabaseException;

	public void removeResources(Set<Integer> resourceIdSet) throws ResourceNotFoundException, DatabaseException;

	public void updateMessage(String content, int messageId) throws MessageNotFoundException, DatabaseException;

	public void updateTitle(String title, int sessionId) throws SessionNotFoundException, DatabaseException;
}
